vm_event: clear up return value of vm_event_monitor_traps
authorTamas K Lengyel <tamas@tklengyel.com>
Tue, 28 Jun 2016 09:36:03 +0000 (11:36 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 28 Jun 2016 09:36:03 +0000 (11:36 +0200)
commit9b15b2e367a8565c73d5ba975e05c89c99078e60
tree339d05a6bb66fc273d448bb2761b25d06115cdb4
parent2b63aa1d5032b7d1acd3314a1bb1f0592e5e64f6
vm_event: clear up return value of vm_event_monitor_traps

The return value has not been clearly defined, with the function
never returning 0 which seemingly indicated a condition where the
guest should crash.

In this patch we define -rc as error condition where a subscriber is
present but an error prevented the notification from being sent;
0 where there is no subscriber or the notification was sent and the vCPU
is not paused (i.e. safe to continue execution as normal); and 1 where the
notification was sent with the vCPU paused and we are waiting for a
response.

Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/monitor.c
xen/arch/x86/hvm/vmx/vmx.c
xen/common/vm_event.c